package com.edgar.paysdk;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.edgar.paysdk.ali.PayResult;

import org.jetbrains.annotations.NotNull;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        PaySdk.initialize(this);
        PaySdk.setWeChatAppId("");
        PayReq payReq = PayReq.obtain(this,"签名");
        PayPlatform payPlatform = PaySdk.getPay(PayType.Ali);
        payPlatform.setPayListener(new PayListener() {
            @Override
            public void onStartPay(@NotNull PayPlatform payPlatform) {

            }

            @Override
            public void onError(@NotNull PayPlatform payPlatform, @NotNull Throwable error) {

            }

            @Override
            public void onSuccess(@NotNull PayPlatform payPlatform) {

            }

            @Override
            public void onPayHandle(@NotNull PayPlatform payPlatform) {

            }

            @Override
            public void onCancel(@NotNull PayPlatform payPlatform) {

            }
        });
        payPlatform.pay(payReq);
    }
}
